package com.project.communitymanagement.service.impl;

import com.project.communitymanagement.common.BaseServiceImpl;
import com.project.communitymanagement.common.Page;
import com.project.communitymanagement.entity.TbTurnoverDts;
import com.project.communitymanagement.mapper.TbTurnoverDtsMapper;
import com.project.communitymanagement.service.TbTurnoverDtsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ProjectName: epidemic-prevention-backend
 * @Package: com.project.communitymanagement.service.impl
 * @ClassName: TbTurnoverDtsServiceImpl
 * @Author: "XGP"
 * @Description:
 * @Date: 2022/03/23 10:47
 * @Version: 1.0
 */
@Service
public class TbTurnoverDtsServiceImpl  extends BaseServiceImpl<TbTurnoverDtsMapper, TbTurnoverDts> implements TbTurnoverDtsService {

    @Autowired
    private TbTurnoverDtsMapper tbturnoverdtsMapper;

    @Override
    protected TbTurnoverDtsMapper mapper() {
        return tbturnoverdtsMapper;
    }

    @Override
    protected TbTurnoverDts defaultModel() {
        return new TbTurnoverDts();
    }

    @Override
    public Page<TbTurnoverDts> getPages(Page<TbTurnoverDts> page) {
        if(page.getRequestData().getCreate_user() != null && !page.getRequestData().getCreate_user().equals("admin")){
            page.getRequestData().setUsername(page.getRequestData().getCreate_user());
            page.getRequestData().setCreate_user(null);
        }
        return super.getPages(page);
    }
}

